package com.xuan.factory.simple;

/**
 * 简单工厂模式
 * @工厂：     SimpleFactory
 * @抽象产品    Device
 * @具体产品：   Phone, Computer
 *
 * @description: 提供一个简单工厂，通过输入的参数，返回对应的产品对象
 */
public class SimpleFactoryDemo {
    public static void main(String[] args) {
        SimpleFactory simpleFactory = new SimpleFactory();
        Device phone = simpleFactory.createDevice("phone");
        Device computer = simpleFactory.createDevice("computer");
        phone.produce();
        computer.produce();
    }
}
